import request from '@/utils/request'

const SalesApi = {
  /*添加辖区*/
  addArea(data, errorback) {
    return request._postBody('/shop/sales/area/add', data, errorback);
  },
  getData(data, errorback) {
    return request._postBody('/shop/sales/area/index', data, errorback);
  },
  regionLists(data, errorback) {
    return request._postBody('/shop/data/region/lists', data, errorback);
  },
  updateArea(data, errorback) {

    return request._postBody('/shop/sales/area/edit', data, errorback);
  },
  deleteArea(data, errorback) {
    return request._postBody('/shop/sales/area/delete?areaId=' + data, {}, errorback);
  },
  // 获取所有辖区
  getAreaList() {
    return request._get('/shop/sales/area/list', {}, true);
  },
  addPerson(data, errorback) {
    return request._postBody('/shop/sales/person/add', data, errorback);
  },
  updatePerson(data, errorback) {
    return request._postBody('/shop/sales/person/edit', data, errorback);
  },

  getPersonData(data, errorback) {
    return request._postBody('/shop/sales/person/index', data, errorback);
  },
  deletePerson(data, errorback) {
    return request._postBody('/shop/sales/person/delete?personId=' + data, {}, errorback);
  },
  getPersonDetail(data) {
    return request._get('/shop/sales/person/toEdit?personId=' + data, {}, true);
  },
  getAllSales() {
    return request._post('/shop/sales/person/listAll', {}, true);
  }

}
export default SalesApi;
